UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vzsm7hzmCPJtTbMLosy826NQHfNxH6vfVBX/AXZrEcA=' 
WHERE 
  key_id = 'd5deaf0f526424606141d79b4917efa189be2c12b441fa79d6c644f31e50b66f' 
  AND (
    token = 'Vzsm7hzmCPJtTbMLosy826NQHfNxH6vfVBX/AXZrEcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026