UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'msbomQVV+HqWx7kl/g+aHTBbfz4L+1FQipPN0pXdGZY=' 
WHERE 
  key_id = '9c88fcfed2a95b2438111ddd810d7d7678d43456373ca5a684386d55898d2a97' 
  AND (
    token = 'msbomQVV+HqWx7kl/g+aHTBbfz4L+1FQipPN0pXdGZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036