UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AFJykWgDlwruy3IY5/nQaJ9p1SMKPlPL5LQaVCVlXeY='
WHERE
key_id = '0aba58ce2dd92c14c3ffdb5e820a5292f7e97e44fb60feb5b47316142e851a90'
AND (
token = 'AFJykWgDlwruy3IY5/nQaJ9p1SMKPlPL5LQaVCVlXeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)