UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/vp35qrLpZgIxR1CoV2Udmr1Z4OU9LfddtALSSAodEw=' 
WHERE 
  key_id = '42e14b58e87fd2d330ac7ad92302ce1863c7ee0298545fb4d4587c17da793ac5' 
  AND (
    token = '/vp35qrLpZgIxR1CoV2Udmr1Z4OU9LfddtALSSAodEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026