UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4m1tA6jQMG2CFxXnft1epXz3AxHbTqd05+5PQ2zyTBs=' 
WHERE 
  key_id = '02809d353a705133c2fd2c790f42723a639b95176345fff8f87203419f7ef8be' 
  AND (
    token = '4m1tA6jQMG2CFxXnft1epXz3AxHbTqd05+5PQ2zyTBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033