UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AxrXWW4UsrncIVb3UyB8MRzHjoX5lr5CVpHsgZU7lf0='
WHERE
key_id = 'cc28f3b73093fc209e05469f2bd34a63cb8b7418e57e428ac5099826994073b9'
AND (
token = 'AxrXWW4UsrncIVb3UyB8MRzHjoX5lr5CVpHsgZU7lf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)