UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IgxF0FQLJeA4BGVM7FIMeVuPXWnCv1r5uaMxvqNBSlI='
WHERE
key_id = '117ec460270b1d4c45ca2f9807142815d3c71a567581f46c93e545f8c7d357f0'
AND (
token = 'IgxF0FQLJeA4BGVM7FIMeVuPXWnCv1r5uaMxvqNBSlI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)