UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'knXWdy/uzzPpQpA+kI+gIaLc/WdQo31rOGceGBRQEZI='
WHERE
key_id = '0db002da16a5d7c50a49f408c743273118f388bb094352b0eae65181562f0ab2'
AND (
token = 'knXWdy/uzzPpQpA+kI+gIaLc/WdQo31rOGceGBRQEZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)