UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iaCHQZ9YDcpmNQpOMSmMRdqvBHnS1FhvnAhq4mbVYnA=' 
WHERE 
  key_id = 'e42cb5c86b4214d3d8441e859f32313023c3ff27901a4af70ebcefbed71a0d27' 
  AND (
    token = 'iaCHQZ9YDcpmNQpOMSmMRdqvBHnS1FhvnAhq4mbVYnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035