UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zg14zgts1BZJujU6OJAVBSTE0Fm/Epus90x4MFi3QFI='
WHERE
key_id = 'd49e7e290e61d9aec7fbaf899ec6ef337641b8c0d4fffe98b86ccfa8bd3bfc24'
AND (
token = 'Zg14zgts1BZJujU6OJAVBSTE0Fm/Epus90x4MFi3QFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)