UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rnNqBOs+Ame7FioBBWHmCF0oXdouMHLehM75Rz52pDc=' 
WHERE 
  key_id = '57a1a062c0bb8304ca1b534bc88a5fbc9b34090f7d6a0be3b745c6c33878bdcb' 
  AND (
    token = 'rnNqBOs+Ame7FioBBWHmCF0oXdouMHLehM75Rz52pDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036