UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1YbfWNxj5rvhCXpXkPrCohBU8sBQY6t4DS33XyBn/aI='
WHERE
key_id = '51d9c5d25879a67e931a6ad295bc91ea6d13f841e95476e1ab9a73bf95b14d33'
AND (
token = '1YbfWNxj5rvhCXpXkPrCohBU8sBQY6t4DS33XyBn/aI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)