UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8grNE5IuIPZitZZ/2l+Rcg561pz84dX9uCtKTQiqxBc='
WHERE
key_id = '18e68246b22847ecdd9d61cc5faa7d594b3bae856c256921241ac8f9684f93e1'
AND (
token = '8grNE5IuIPZitZZ/2l+Rcg561pz84dX9uCtKTQiqxBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)