UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ImEx7cCy0WQVlQLHFVL01v+Lo7Fv9oq/BiTGRKmdfsA=' 
WHERE 
  key_id = '83c8132a525f21aaa651ce6707bb78b001650260454a19e45bbd7d00a64a3ea4' 
  AND (
    token = 'ImEx7cCy0WQVlQLHFVL01v+Lo7Fv9oq/BiTGRKmdfsA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040