UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8zl0sAPCEIPAX5vZsxQUh3V3jH8NypdHstmeJutXO/I='
WHERE
key_id = 'fb06036ac0d0a040b282be81c4e4d29f8ca7d79b3f765445ac9c96c2ff1fd505'
AND (
token = '8zl0sAPCEIPAX5vZsxQUh3V3jH8NypdHstmeJutXO/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)