UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U0kX8H3XWShVSp+sH5Ask1nFPAVZ4SJPLJOa7pIt5Do='
WHERE
key_id = '550f541dff489bcdc8fdc3d09ae7ea82a040b66ba2ddfe3f018f39e282b5ac14'
AND (
token = 'U0kX8H3XWShVSp+sH5Ask1nFPAVZ4SJPLJOa7pIt5Do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)