UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kyIPvPBb/NgOblsRWaCDB1LiHfAfX4xZCoT4N3Xs/Sc=' 
WHERE 
  key_id = 'ade93f415dcf8c5b18a5ea81ce884986965cb7b2871a65f0c1d3176b78f2719a' 
  AND (
    token = 'kyIPvPBb/NgOblsRWaCDB1LiHfAfX4xZCoT4N3Xs/Sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048