UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ztGFY7WLGpFXgz0zxVicKIZS9q1Z/3FGLeR/s8DKjo='
WHERE
key_id = '035e4cc249b8246cdfc9fc22f3803bfe8756d1606f3eb96cf2afc80763995b6a'
AND (
token = '2ztGFY7WLGpFXgz0zxVicKIZS9q1Z/3FGLeR/s8DKjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)