UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VL9vr105iJXpLUCQIsuFbm4x2FeGIKWoGwkkl87e4bw=' 
WHERE 
  key_id = '9c8576ea3d320898ae942fdd57de61a63978b40a2dcba4788ffe1b7bd58e9647' 
  AND (
    token = 'VL9vr105iJXpLUCQIsuFbm4x2FeGIKWoGwkkl87e4bw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031