UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPEoRpNsPSFHEPiQGToMuKu6aBO4KDUpdDBcjRfxCBI='
WHERE
key_id = '185ec23e37f82e7eddeeabe3aae2f636d6abc720a6f5065bb7f793d9ecff3450'
AND (
token = 'oPEoRpNsPSFHEPiQGToMuKu6aBO4KDUpdDBcjRfxCBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)