UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '18cpPX5i+aNT9tV5H+86PmwaH6wIv+s3+cyg5QpYihM=' 
WHERE 
  key_id = '8c3d7d5c6a09bff36b180e5d829e0bf8aac8bb603a1382e3bffe81cf3757477a' 
  AND (
    token = '18cpPX5i+aNT9tV5H+86PmwaH6wIv+s3+cyg5QpYihM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030