UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nPmRoczJmNTS5MTmJ9zEMIHa99zHxA2oNdW+ckBxWuY='
WHERE
key_id = 'd795cbbdf33d27befc010361d44edbf91510182572191babbd6a94cb3e537d72'
AND (
token = 'nPmRoczJmNTS5MTmJ9zEMIHa99zHxA2oNdW+ckBxWuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)