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