UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Aw7vpNt/IAE6NETFuqKMUtCxsPtP3roEmVYa4kLEP8s='
WHERE
key_id = 'daa2b89f1d3f85c6ddb83176d37c0eb4141bf890f19bca476879d803ff37da19'
AND (
token = 'Aw7vpNt/IAE6NETFuqKMUtCxsPtP3roEmVYa4kLEP8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)