UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tche41b3o4rX/7svCSDMQqyTcL6PXgmYNZyEmuSCKPM=' 
WHERE 
  key_id = '6067bdf3bb361be1a55a21f08f0446c80560c57ab880639c5de0f0ec2d5040b6' 
  AND (
    token = 'Tche41b3o4rX/7svCSDMQqyTcL6PXgmYNZyEmuSCKPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027