UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OO4X6JFRkkwfGnDS5xwOacBltubgHNeMK13UQYs+9QU='
WHERE
key_id = '9378936910a6cb0053afccdf8aff0dd2b8c09841cc0389d40f3ede18c65690ed'
AND (
token = 'OO4X6JFRkkwfGnDS5xwOacBltubgHNeMK13UQYs+9QU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)