UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p/bUY49NmQ1DcSlTIlnwQ7PIn4PybLD6/9I47tpXu1k=' 
WHERE 
  key_id = '68c348316c245389023325e8e97ee45e874b154616e400f5f90f5920bcd75ae1' 
  AND (
    token = 'p/bUY49NmQ1DcSlTIlnwQ7PIn4PybLD6/9I47tpXu1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025