UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1R+Qtwp0I1h41cyMdWUDvRDkegmDCHpYfnw5R7ewBB8='
WHERE
key_id = 'e922a54f25bf82930fece277f4d7aa5a81d48ffac0600ca87b222e6a1ecfc4b6'
AND (
token = '1R+Qtwp0I1h41cyMdWUDvRDkegmDCHpYfnw5R7ewBB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)