UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2yBZob2kSF6fXlGZelomwVUTVrZ0gjUqZMqK/a60iMY='
WHERE
key_id = '760d1e2b769ddb07481ac2489c911f3e468129ae7fe617339e55044e1ec60049'
AND (
token = '2yBZob2kSF6fXlGZelomwVUTVrZ0gjUqZMqK/a60iMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)