UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+LdwP48OgnwUNVqT8dViNJwZI4csQpcVZp2DbPiCT9s='
WHERE
key_id = 'ceb82cc3b2684d585e36b8e78f08d1065caecda0192c80fdfaab01b3f68e1909'
AND (
token = '+LdwP48OgnwUNVqT8dViNJwZI4csQpcVZp2DbPiCT9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)