UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yiQF/WXX/LNQMBLosWhGZj6LatNBbRxCYF2Kf7jFJn4='
WHERE
key_id = 'ec54586e1f084a7dff72ba23fc35b20238a835a7ef40b14fb2b8bb07366c116f'
AND (
token = 'yiQF/WXX/LNQMBLosWhGZj6LatNBbRxCYF2Kf7jFJn4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)