UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5C9sOsEy2qGFHsQJzL6qoG5Qb4bjEd2z3R3npNnEk6Q='
WHERE
key_id = 'ce02ec18ed371f8c50edbfe883dc88e8e6cd1fdc53c113c3950e97b592ec6549'
AND (
token = '5C9sOsEy2qGFHsQJzL6qoG5Qb4bjEd2z3R3npNnEk6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)