UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bsIMKuwP/oabyr84gSjbzCHGmhzQOeUfkfvRlZdAXgY='
WHERE
key_id = 'e3ae73fd3fbe26b726cd13b68d108069b39126fdf7b8074880e14f5b37659d77'
AND (
token = 'bsIMKuwP/oabyr84gSjbzCHGmhzQOeUfkfvRlZdAXgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)