UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jMo0O/lPjIzOR6EufSrAgxbgauKEbQo+jOW5jqHIYeI='
WHERE
key_id = 'd4d0ce3325aa5dda1f7d042e6170d07888c30192713f4b8927dbfb461be74ef2'
AND (
token = 'jMo0O/lPjIzOR6EufSrAgxbgauKEbQo+jOW5jqHIYeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)